package com.heima.apis.article;


import com.heima.model.article.pojos.ApArticle;
import com.heima.model.article.pojos.ApArticleConfig;
import com.heima.model.common.dtos.PageResponseResult;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.WmFindNewsCommentDto;
import com.heima.model.wemedia.dtos.WmNewsPageDto;
import com.heima.model.wemedia.dtos.WmUpdateCommentStatusDto;
import com.heima.model.wemedia.vos.WmCommentVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;
import java.util.List;

@FeignClient("leadnews-article")
public interface ApArticleClient {

    @GetMapping("/api/v1/article/get")
    public ApArticle getById(@RequestParam Long id);

    /**
     * 获取文章配置
     * @param id
     * @return
     */
    @PostMapping("/api/v1/article/config")
    ApArticleConfig getArticleConfig(@RequestParam Long id);


    //获取文章评论管理列表
    @PostMapping("/api/v1/article/manage")
    PageResponseResult getCommentManageList(@RequestBody WmFindNewsCommentDto dto, @RequestParam Integer id);


    //修改文章评论状态
    @PostMapping("/api/v1/article/comment_status")
    ResponseResult updateCommentStatus(@RequestBody WmUpdateCommentStatusDto dto);


    /**
     * 图文统计数据
     * @param beginDate
     * @param endDate
     * @param userId
     * @return
     */
    @PostMapping("/api/v1/article/all")
    List<ApArticle> getAllArticle(@RequestParam Date beginDate, @RequestParam Date endDate, @RequestParam Integer userId);


    /**
     * 图文展示
     */
    @PostMapping("/api/v1/article/newsPage")
    public ResponseResult getNewsPage(@RequestBody WmNewsPageDto dto , @RequestParam Integer wmUserId);
}
